home *** CD-ROM | disk | FTP | other *** search
/ Halting the Hacker - A P…uide to Computer Security / Halting the Hacker - A Practical Guide to Computer Security.iso / rfc / rfc860.txt < prev    next >
Text File  |  1997-04-01  |  8KB  |  228 lines

  1.  
  2. Network Working Group                                          J. Postel
  3. Request for Comments: 860                                    J. Reynolds
  4.                                                                      ISI
  5. Obsoletes: NIC 16238                                            May 1983
  6.  
  7.                        TELNET TIMING MARK OPTION
  8.  
  9.  
  10. This RFC specifies a standard for the ARPA community.  Hosts on the ARPA
  11. Internet are expected to adopt and implement this standard.
  12.  
  13. 1.  Command Name and Code
  14.  
  15.    TIMING-MARK          6
  16.  
  17. 2.  Command Meanings
  18.  
  19.    IAC DO TIMING-MARK
  20.  
  21.       The sender of this command REQUESTS that the receiver of this
  22.       command return a WILL TIMING-MARK in the data stream at the
  23.       "appropriate place" as defined in section 4 below.
  24.  
  25.    IAC WILL TIMING-MARK
  26.  
  27.       The sender of this command ASSURES the receiver of this command
  28.       that it is inserted in the data stream at the "appropriate place"
  29.       to insure synchronization with a DO TIMING-MARK transmitted by the
  30.       receiver of this command.
  31.  
  32.    IAC WON'T TIMING-MARK
  33.  
  34.       The sender of this command REFUSES to insure that this command is
  35.       inserted in the data stream at the "appropriate place" to insure
  36.       synchronization.
  37.  
  38.    IAC DON'T TIMING-MARK
  39.  
  40.       The sender of this command notifies the receiver of this command
  41.       that a WILL TIMING-MARK (previously transmitted by the receiver of
  42.       this command) has been IGNORED.
  43.  
  44. 3.  Default
  45.  
  46.    WON'T TIMING-MARK, DON'T TIMING-MARK
  47.  
  48.       i.e., No explicit attempt is made to synchronize the activities at
  49.       the two ends of the TELNET connection.
  50.  
  51. 4.  Motivation for the Option
  52.  
  53.  
  54.  
  55. Postel & Reynolds                                               [Page 1]
  56.  
  57.  
  58.  
  59. RFC 860                                                         May 1983
  60.  
  61.  
  62.    It is sometimes useful for a user or process at one end of a TELNET
  63.    connection to be sure that previously transmitted data has been
  64.    completely processed, printed, discarded, or otherwise disposed of.
  65.    This option provides a mechanism for doing this.  In addition, even
  66.    if the option request (DO TIMING-MARK) is refused (by WON'T
  67.    TIMING-MARK) the requester is at least assured that the refuser has
  68.    received (if not processed) all previous data.
  69.  
  70.    As an example of a particular application, imagine a TELNET
  71.    connection between a physically full duplex terminal and a "full
  72.    duplex" server system which permits the user to "type ahead" while
  73.    the server is processing previous user input.  Suppose that both
  74.    sides have agreed to Suppress Go Ahead and that the server has agreed
  75.    to provide echoes.  The server now discovers a command which it
  76.    cannot parse, perhaps because of a user typing error.  It would like
  77.    to throw away all of the user's "type-ahead" (since failure of the
  78.    parsing of one command is likely to lead to incorrect results if
  79.    subsequent commands are executed), send the user an error message,
  80.    and resume interpretation of commands which the user typed after
  81.    seeing the error message.  If the user were local, the system would
  82.    be able to discard the buffered input; but input may be buffered in
  83.    the user's host or elsewhere.  Therefore, the server might send a DO
  84.    TIMING-MARK and hope to receive a WILL TIMING-MARK from the user at
  85.    the "appropriate place" in the data stream.
  86.  
  87.    The "appropriate place", therefore (in absence of other information)
  88.    is clearly just before the first character which the user typed after
  89.    seeing the error message.  That is, it should appear that the timing
  90.    mark was "printed" on the user's terminal and that, in response, the
  91.    user typed an answering timing mark.
  92.  
  93.    Next, suppose that the user in the example above realized that he had
  94.    misspelled a command, realized that the server would send a DO
  95.    TIMING-MARK, and wanted to start "typing ahead" again without waiting
  96.    for this to occur.  He might then instruct his own system to send a
  97.    WILL TIMING-MARK to the server and then begin "typing ahead" again.
  98.    (Implementers should remember that the user's own system must
  99.    remember that it sent the WILL TIMING-MARK so as to discard the
  100.    DO/DON'T TIMING-MARK when it eventually arrives.)  Thus, in this case
  101.    the "appropriate place" for the insertion of the WILL TIMING-MARK is
  102.    the place defined by the user.
  103.  
  104.    It should be noted, in both of the examples above, that it is the
  105.    responsibility of the system which transmits the DO TIMING-MARK to
  106.    discard any unwanted characters; the WILL TIMING-MARK only provides
  107.    help in deciding which characters are "unwanted".
  108.  
  109. 5.  Description of the Option
  110.  
  111.  
  112. Postel & Reynolds                                               [Page 2]
  113.  
  114.  
  115.  
  116. RFC 860                                                         May 1983
  117.  
  118.  
  119.    Suppose that Process A of Figure 1 wishes to synchronize with B. The
  120.    DO TIMING-MARK is sent from A to B.  B can refuse by replying WON'T
  121.    TIMING-MARK, or agree by permitting the timing mark to flow through
  122.    his "outgoing" buffer, BUF2.  Then, instead of delivering it to the
  123.    terminal, B will enter the mark into his "incoming" buffer BUF1, to
  124.    flow through toward A.  When the mark has propagated through B's
  125.    incoming buffer, B returns the WILL TIMING-MARK over the TELNET
  126.    connection to A.
  127.  
  128.       PROCESS A    TELNETconnection    PROCESS B           Terminal
  129.       +-----------+                +---------------+ Timing+-------+
  130.       |           |WILL TIMING MARK|     BUF 1     |  Mark |       |
  131.       |           |<---------------|--|-|-|-|-|-|--|<------|       |
  132.       |           |                |  |-|-|-|-|-|  |   ^   |       |
  133.       |           |                |     BUF 2     |   ^   |       |
  134.       |           |--------------->|--|-|-|-|-|-|--|------>|       |
  135.       |           | DO TIMING MARK |  |-|-|-|-|-|  |       |       |
  136.       +-----------+                +---------------+       +-------+
  137.                                      (NVT process).ME;
  138.                          Figure 1
  139.  
  140.    When A receives the WILL TIMING-MARK, he knows that all the
  141.    information he sent to B before sending the timing mark been
  142.    delivered, and all the information sent from B to A before turnaround
  143.    of the timing mark has been delivered.
  144.  
  145.    Three typical applications are:
  146.  
  147.       A. Measure round-trip delay between a process and a terminal or
  148.          another process.
  149.  
  150.       B. Resynchronizing an interaction as described in section 4 above.
  151.          A is a process interpreting commands forwarded from a terminal
  152.          by B. When A sees an illegal command it:
  153.  
  154.          i.   Sends <carriage return>, <line feed>, <question mark>.
  155.  
  156.          ii.  Sends DO TIMING-MARK.
  157.  
  158.          iii. Sends an error message.
  159.  
  160.          iv.  Starts reading input and throwing it away until it
  161.               receives a WILL TIMING-MARK.
  162.  
  163.          v.   Resumes interpretation of input.
  164.  
  165.  
  166.  
  167.  
  168.  
  169. Postel & Reynolds                                               [Page 3]
  170.  
  171.  
  172.  
  173. RFC 860                                                         May 1983
  174.  
  175.  
  176.          This achieves the effect of flushing all "type ahead" after the
  177.          erroneous command, up to the point when the user actually saw
  178.          the question mark.
  179.  
  180.       C.  The dual of B above.  The terminal user wants to throw away
  181.          unwanted output from A.
  182.  
  183.          i.   B sends DO TIMING-MARK, followed by some new command.
  184.  
  185.          ii.  B starts reading output from A and throwing it away until
  186.               it receives WILL TIMING-MARK.
  187.  
  188.          iii. B resumes forwarding A's output to the terminal.
  189.  
  190.          This achieves the effect of flushing all output from A, up to
  191.          the point where A saw the timing mark, but not output generated
  192.          in response to the following command.
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226. Postel & Reynolds                                               [Page 4]
  227.  
  228.